<script>
  /*商品详细通用函数*/

   var priceControl={
              base:<{$goods.current_price}>,
             // _format:<{$money_format|default:'false'}>,
			 _format:<{$money_format|default:'false'}>,/*decimals":2,"dec_point":".","thousands_sep":"","fonttend_decimal_type":0,"fonttend_decimal_remain":2,"sign":"\uffe5*/
              format:function(num){
                var part;
                if(!num)return;
                var num = num.toFloat();
                    num = num.round(this._format.decimals)+'';
                    var p =num.indexOf('.');
                    if(p<0){
                        p = num.length;
                        part = '';
                    }else{
                        part = num.substr(p+1);
                    }
                    while(part.length<this._format.decimals){
                            part+='0';
                        }
                    var c=[];
                    while(p>0){
                        if(p>2){
                            c.unshift(num.substr(p-=3,3));
                        }else{
                            c.unshift(num.substr(0,p));
                            break;
                        }
                    }
                    if(!part){
                        this._format.dec_point='';
                    }
                    return (this._format.sign||"")+c.join(this._format.thousands_sep)+this._format.dec_point+part;
            }
       };

    String.implement({
      toFormElements:function(){
            if(!this.contains('=')&&!this.contains('&'))return new Element('input',{type:'hidden'});
            var elements=[];
            var queryStringHash=this.split('&');
            $A(queryStringHash).each(function(item){
                if(item.contains('=')){
                    item=$A(item.split('='));
                    elements.push(new Element('input',{type:'hidden',name:item[0],value:item[1]}));
                }else{
                  elements.push(new Element('input',{type:'hidden',name:item}));
                }
            });
            return new Elements(elements);
            }
    });
    Number.implement({
           interzone:function(min,max){
                 var _v=this.toFloat();
                 if(!_v)_v=0;
                 return _v>=min&&_v<=max;
             }
          });
   var keyCodeFix=[48,49,50,51,52,53,54,55,56,57,96,97,98,99,100,101,102,103,104,105,8,9,46,37,39<{if $goods.type.floatstore}>,110,190<{/if}>];


</script>

<div class="GoodsInfoWrap">
  <div id="goods-viewer">
  
  <!--暂时针对于团购 开放立即购买功能时需修改-->
  <form action="<{link app=b2c ctl=site_cart act=addToCart}>" class="fastbuy-form" id="fastbuy-form" method="POST"></form>

<!--<table width="100%" id="goods-viewer">
    <tr>
      <td colspan="2">
      <h2 class="goodsname"><{$goods.name|escape:"html"}></h2></td>
    </tr>
    <tr>
      <td valign="top" align="center"><{include file="site/product/goodspics.html" app=b2c}> </td>
      <td width="60%" valign="top" class="goods-gg" >
      <table cellpadding="0" cellspacing="0" border="0" width="100%" class="goods-spec-list " >
          <tr class='goods-price list'>
            <td >
            <{foreach from=$info_page_list item=item}>
                <{include file=$item.file app=$item.app }>
            <{/foreach}>
            </td>
          </tr>
        </table>-->
      
        <h2 class="goodsname"><{$goods.name|escape:"html"}></h2>
<div id="goods-viewer" style="overflow:hidden; height:auto">
<form class="goods-action" action="<{link app=b2c ctl='site_cart' act='addToCart' arg0='goods'}>" gnotify="<{link app=b2c ctl=site_product act=gnotify}>" method="post"
      <{if $goods.setting.buytarget==2}> target="_blank_cart"<{elseif $goods.setting.buytarget==3}> target="_dialog_minicart"<{/if}>>
	<div class="goods_leftbox"><{include file="site/product/goodspics.html" app=b2c}></div>
	<div class="goods_rightbox">
		<div class='goods-price list'>
			<{foreach from=$info_page_list item=item}>
                <{include file=$item.file app=$item.app }>
            <{/foreach}>
		</div>
        <!------------------------------------ 购买区域 开始 -------------------------------->

        <{assign var=tmp value=$goods.product}>
        <{assign var=product0bn value=$tmp|array_shift}>

        <{if count($promotions)>0}>
        <ul class="boxBlue list">
          <{foreach from=$promotions item=promotion key=key}>
          <li><strong class="fontcolorRed"><{$promotion.pmt_describe}></strong><span class="font11px fontcolorBlack"><{$promotion.pmt_time_begin|userdate}> ~ <{$promotion.pmt_time_end|userdate}></span></li>
          <{/foreach}>
        </ul>
        <{/if}>

        <{if !$login&&$mLevel}>
        <div class='mprice' >
         <{if $goods_point.avg}>
  <!--商品评分区块-->
  <{/if}>
        <h4 class="member_price"><{t}>会员价:<{/t}></h4>
        <ul style="margin:0 0 0 10px">
          <{assign var=aProduct value=$goods[product]|current}>
    <{if $env.conf.b2c.site.member_price_display == 1}>
          <{foreach from=$aProduct.price.member_lv_price item=lItem name=mlv}>
          <li> <span><{t}><{$lItem.title}>:<{/t}></span> <span class='mlvprice fontcolorRed lv-<{$lItem.level_id}>' mlv='<{$lItem.level_id}>'><{$lItem.price|cur_odr:$order.currency}></span> </li>
          <{/foreach}>
              <{else}>
          <{assign var=aProductPrice value=$aProduct[price][member_lv_price]}>
    <li> <span><{t}><{$aProductPrice[$this_member_lv_id][title]}>:<{/t}></span> <span class='mlvprice fontcolorRed lv-<{$aProductPrice[$this_member_lv_id][level_id]}>' mlv='<{$aProductPrice[$this_member_lv_id][level_id]}>'><{$aProductPrice[$this_member_lv_id][price]|cur_odr:$order.currency}></span> </li>
    <{/if}>

        </ul>
        </div>
        <{/if}>
<div class="sale-info"><{if $promotionMsg||$promotionOrder}>可享受的促销：<{$promotionMsg}> <{$promotionOrder}><{/if}></div>
        <{if $goods.status == 'false' }>
        <!---已下架--->
        <div class="hight-offline">
          <div class="hightbox">
            <div class="btnBar clearfix">
              <div class="floatLeft" style="font-weight:bold; padding-top:15px;"><{t}>此商品已下架<{/t}></div>
              <div class="floatRight">
                <ul>
                  <li <{if $login!="nologin"}>star="<{$goods.goods_id}>"<{/if}> title="<{$goods.name|escape:html}>"> <a  <{if $login=="nologin"}> href="<{link app="b2c" ctl="site_passport" act="login"}>" <{else}>href="#" onclick="return false;"<{/if}> class="btn-a listact"  rel="nofollow" ><i class="has-icon"> <img src='<{$env.app.res_url}>/bundle/collect_icon.gif' /></i><span >
                  <div class="fav"><{t}>收藏此商品<{/t}></div>
                  <div class="nofav"><{t}>已收藏<{/t}></div>
                  </span></a>
                  </li>
                  <!-- <li><a href="#" class="btn-send"><{t}>发送给好友<{/t}></a></li> -->
                </ul>
              </div>
            </div>
          </div>
        </div>
        <{else}>
        <!---购物面板--->
        <div class='hightline'>
          <div class='hightbox'>
            <!---规格开始--->
            <{if $goods.spec }>
            <{include file='site/product/spec.html' app=b2c}>
            <{/if}>
            <!---规格结束--->
            <!--购买数量-->
            <div class='buyinfo'>
            <label><span><{t}>数量：<{/t}></span></label><ul><li><div class="Numinput">
                      <input type="text" name="goods[num]" size="5" value=1 />
                      <span  class="numadjust increase"></span> <span  class="numadjust decrease"></span> </div></li>
                      <li><{if $goods.package_unit}><{$goods.package_unit}><{t}>(每<{/t}><{$goods.package_scale}><{t}>个一<{/t}><{$goods.package_unit}>)<{/if}></li>
                      <li><span <{if $showStorage != 'true'}>style='display:none;'<{/if}>><{t}>&nbsp;&nbsp;(库存<{/t}><span class='store'><{if $goods.store >= 9999 || $goods.store === null || $goods.store === ''}>9999+<{else}><{$goods.store - $goods.product_freez}><{/if}></span>)</span></li>
                         </ul>
                        </div>
              <!--<table width='auto'>
                <tr>
                  <td style="vertical-align:middle"><span><{t}>数量：<{/t}></span></td>
                  <td><div class="Numinput">
                      <input type="text" name="goods[num]" size="5" value=1 />
                      <span  class="numadjust increase"></span> <span  class="numadjust decrease"></span> </div>
                  <td><{if $goods.package_unit}><{$goods.package_unit}><{t}>(每<{/t}><{$goods.package_scale}><{t}>个一<{/t}><{$goods.package_unit}>)<{/if}></td>
                  <td></td>
                  <td><span <{if $showStorage != 'true'}>style='display:none;'<{/if}>><{t}>&nbsp;&nbsp;(库存<{/t}><span class='store'><{if $goods.store >= 9999 || $goods.store === null || $goods.store === ''}>9999+<{else}><{$goods.store - $goods.product_freez}><{/if}></span>)</span></td>
                </tr>
              </table>-->
            </div>
            <!--购买数量结束-->
            <!------------------------------------ 购买 按钮 -------------------------------->
            <input type="hidden" name="goods[goods_id]" value="<{$goods.goods_id}>" />
            <input type="hidden" name="goods[pmt_id]" value="<{$goods.pmt_id}>" />
            <{if !$goods.spec }>
            <input type='hidden' name='goods[product_id]' value='<{$product0id}>'/>
            <{/if}> <div class="btnBar clearfix" <{if count($goods.product)<0}>style="visibility:hidden"<{/if}>>
            <div class="floatLeft"> 
            
            <!--页面按钮service形式 start -->
            <{foreach from=$btn_page_list item=item}>
                <{include file=$item.file app=$item.app }>
            <{/foreach}>
            <!--页面按钮service形式 end -->
            </div>
            <div class="floatleft">
              <ul class="button">
                <li  class="star-off" <{if $login!="nologin"}>star="<{$goods.goods_id}>"<{/if}> title="<{$goods.name|escape:html}>"> <a  <{if $login=="nologin"}> href="<{link app="b2c" ctl="site_passport" act="login"}>" <{else}>href="#" onclick="return false;"<{/if}> class="btn-a listact"  rel="nofollow" ><i class="has-icon"> <img src='<{$env.app.res_url}>/bundle/collect_icon.gif' /></i><span >
                <div class="fav"><{t}>收藏此商品<{/t}></div>
                <div class="nofav"><{t}>已收藏<{/t}></div>
                </span></a>
                </li>
              </ul>
            </div>
          </div>
          <!--购买按钮结束-->
        </div>
    </div>
    <{/if}>
    <!------------------------------------ 配件 开始 -------------------------------->
    <{if $goods.adjunct && count($goods.adjunct)>0}>
    <{include file='site/product/adjunct.html' app=b2c}>
    <{/if}>
</div>
</form>

<!-- </td>
    </tr>
  </table>-->
  <!--货品列表-->
  <{if $goods.spec}>
  <{include file='site/product/products.html' app=b2c}>
  <{/if}>
  <div style="clear:both"></div>
  <!------------------------------------ 购买区域 结束 -------------------------------->
  <!--页面body page start -->
  <{if $body_page_list}>
    <div class="goods-detail-tab clearfix" > </div>
    <{foreach from=$body_page_list item=item}>
      <{include file=$item.file app=$item.app }>
    <{/foreach}>
  <{/if}>
  <!--页面body page end -->
</div>
</div>
<{include file='site/product/goods_js.html' app=b2c}>